<template>
      <div id="detailofmovie">
    <div class="head">
      <div class="hbox">
        <div class="left" @click="back()">返回</div>
        <div class="middle">{{ movie.movie.nm }}</div>
      </div>
    </div>
    <cinema2 :movie="movie"></cinema2>
  </div>
</template>

<script>
export default {
  name:'detailmovie',
  props:['movieId'],
  created(){
    this.getMovie()
  },
  data(){
    return {
      movie:{},
    }
  },
  methods:{
    async getMovie() {
      await this.axios
        .get(`https://apis.netstart.cn/maoyan/movie/detail?movieId=${this.movieId}`)
        .then((re) => {
          console.log(re);
          this.movie = re.data;
        });
    },
    back() {
      this.$router.go(-1);
    },
  }
}
</script>

<style scoped>
.head {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
}

.hbox {
  height: 50px;
  width: 100%;
  background-color: red;
  line-height: 50px;
  text-align: center;
  color: white;
  position: relative;
}

.head .left {
  position: absolute;
  left: 10px;
}
</style>